/// UserModel 代表后端返回的用户数据
class UserModel {
  UserModel({
    required this.id,
    this.phone,
    this.email,
    this.token,
  });

  final int id;
  final String? phone;
  final String? email;
  final String? token;

  /// 将 JSON 映射为 UserModel
  factory UserModel.fromJson(Map<String, dynamic> json) {
    return UserModel(
      id: json['id'] as int,
      phone: json['phone'] as String?,
      email: json['email'] as String?,
      token: json['token'] as String?,
    );
  }
}
